﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace STF.OrangeDog.Model
{
    public class Blog:BaseModel
    {
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "博客标题")]
        public string Title { get; set; }
        [Required(ErrorMessage = "{0}不能为空")]
        [StringLength(50), Column(TypeName = "varchar(50)")]
        [Display(Name = "内容")]
        public string Content { get; set; }
        [ForeignKey(nameof(Users.Id))]
        public int uid { get; set; }
        [Display(Name = "内容")]
        public DateTime PublishTime { get; set; } = DateTime.Now;
        [Required]
        [ForeignKey(nameof(Users.StateCode))]
        public int StateCode { get; set; }
        [Required]
        [ForeignKey(nameof(Users.StateCode))]
        public int typeId { get; set; }
        [ForeignKey(nameof(UsersInfo.Id))]
        public int fbxsId { get; set; }
        [Display(Name = "等级编号")]
        public int levelId { get; set; }
        [Display(Name = "点赞数")]
        public int GoodPraise { get; set; }
        [Display(Name = "踩数")]
        public int NoGoodPraise { get; set; }
    }
}
